package thread.test04.demo02;

import java.util.concurrent.*;

/**
 * ClassName: MyCallableTest
 * Description:
 *
 * @Author zjl
 * @Create 2025/03/11 19:46
 * @Version 1.0
 */
public class MyCallableTest {
    public static void main(String[] args) throws Exception {
        ExecutorService executorService = Executors.newFixedThreadPool(3);
        MyCallable myCallable = new MyCallable();

        Future<Integer> future1 = executorService.submit(myCallable);
        Future<Integer> future2 = executorService.submit(myCallable);
        Future<Integer> future3 = executorService.submit(myCallable);

        System.out.println("窗口1:" + future1.get());
        System.out.println("窗口2:" + future2.get());
        System.out.println("窗口3:" + future3.get());

        executorService.shutdown();
    }
}
